#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
int n;
int num[maxn];
int arr[maxn];
int p=0;
int t,ma=0;
/*bool check1(){
    for(int i=1;i<=p;i++){
        if(arr[i]<arr[i-1]){
            return false;
        }
    }
    return true;
}*/
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;

    for(int i=1;i<=n;i++){
        cin>>t;
        num[t]++;
        ma=max(ma,t);
    }

    for(int i=1;i<=ma;i++){
        if(num[i]!=0){
            p++;
            arr[p]=num[i];
        }
    }
    /*if(p<=2){
        cout<<abs(arr[2]-arr[1])+arr[2];

    }*/
    /*else if(check1){
        cout<<arr[1];
    }*/
    //else{
    int ans=n;
    for(int i=0;i<=p;i++){
        for(int j=i+1;j<=p;j++){
            if(arr[i]<=arr[j]){
                ans-=arr[i];
                //arr[j]-=arr[i];
                arr[i]=0;
                i=j;
                //break;
            }
            else{
                ans-=arr[j];
                //arr[i]-=arr[j];
                arr[j]=0;
                //continue;
            }
            //cout<<i<<" "<<j<<" "<<ans<<endl;
        }
    }
    cout<<ans;
    //}
    return 0;
}
//rp++;
